(0) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
plus#2(0, x12) → x12
plus#2(S(x4), x2) → S(plus#2(x4, x2))
fold#3(Nil) → 0
fold#3(Cons(x4, x2)) → plus#2(x4, fold#3(x2))
main(x1) → fold#3(x1)
Rewrite Strategy: INNERMOST
(1) CpxTrsMatchBoundsTAProof (EQUIVALENT transformation)
A linear upper bound on the runtime complexity of the TRS R could be shown with a Match-Bound[TAB_LEFTLINEAR,TAB_NONLEFTLINEAR] (for contructor-based start-terms) of 1.
The compatible tree automaton used to show the Match-Boundedness (for constructor-based start-terms) is represented by:
final states : [1, 2, 3]
transitions:
00() → 0
S0(0) → 0
Nil0() → 0
Cons0(0, 0) → 0
plus#20(0, 0) → 1
fold#30(0) → 2
main0(0) → 3
plus#21(0, 0) → 4
S1(4) → 1
01() → 2
fold#31(0) → 5
plus#21(0, 5) → 2
fold#31(0) → 3
plus#21(0, 5) → 4
S1(4) → 2
S1(4) → 4
01() → 3
01() → 5
plus#21(0, 5) → 3
plus#21(0, 5) → 5
S1(4) → 3
S1(4) → 5
0 → 1
0 → 4
5 → 2
5 → 3
5 → 4
(2) BOUNDS(1, n^1)
(3) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
plus#2(0, z0) → z0
plus#2(S(z0), z1) → S(plus#2(z0, z1))
fold#3(Nil) → 0
fold#3(Cons(z0, z1)) → plus#2(z0, fold#3(z1))
main(z0) → fold#3(z0)
Tuples:
PLUS#2(0, z0) → c
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Nil) → c2
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
MAIN(z0) → c4(FOLD#3(z0))
S tuples:
PLUS#2(0, z0) → c
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Nil) → c2
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
MAIN(z0) → c4(FOLD#3(z0))
K tuples:none
Defined Rule Symbols:
plus#2, fold#3, main
Defined Pair Symbols:
PLUS#2, FOLD#3, MAIN
Compound Symbols:
c, c1, c2, c3, c4
(5) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
MAIN(z0) → c4(FOLD#3(z0))
Removed 2 trailing nodes:
PLUS#2(0, z0) → c
FOLD#3(Nil) → c2
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
plus#2(0, z0) → z0
plus#2(S(z0), z1) → S(plus#2(z0, z1))
fold#3(Nil) → 0
fold#3(Cons(z0, z1)) → plus#2(z0, fold#3(z1))
main(z0) → fold#3(z0)
Tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
S tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
K tuples:none
Defined Rule Symbols:
plus#2, fold#3, main
Defined Pair Symbols:
PLUS#2, FOLD#3
Compound Symbols:
c1, c3
(7) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
main(z0) → fold#3(z0)
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:
fold#3(Nil) → 0
fold#3(Cons(z0, z1)) → plus#2(z0, fold#3(z1))
plus#2(0, z0) → z0
plus#2(S(z0), z1) → S(plus#2(z0, z1))
Tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
S tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
K tuples:none
Defined Rule Symbols:
fold#3, plus#2
Defined Pair Symbols:
PLUS#2, FOLD#3
Compound Symbols:
c1, c3
(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^2)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
We considered the (Usable) Rules:none
And the Tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = [1]
POL(Cons(x1, x2)) = [2] + x1 + x2
POL(FOLD#3(x1)) = [2]x12
POL(Nil) = [2]
POL(PLUS#2(x1, x2)) = [2]
POL(S(x1)) = [2]
POL(c1(x1)) = x1
POL(c3(x1, x2)) = x1 + x2
POL(fold#3(x1)) = [2] + x1 + x12
POL(plus#2(x1, x2)) = [1] + [2]x1 + x2 + x12
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:
fold#3(Nil) → 0
fold#3(Cons(z0, z1)) → plus#2(z0, fold#3(z1))
plus#2(0, z0) → z0
plus#2(S(z0), z1) → S(plus#2(z0, z1))
Tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
S tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
K tuples:
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
Defined Rule Symbols:
fold#3, plus#2
Defined Pair Symbols:
PLUS#2, FOLD#3
Compound Symbols:
c1, c3
(11) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
We considered the (Usable) Rules:none
And the Tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(0) = 0
POL(Cons(x1, x2)) = [1] + x1 + x2
POL(FOLD#3(x1)) = x1
POL(Nil) = 0
POL(PLUS#2(x1, x2)) = x1
POL(S(x1)) = [1] + x1
POL(c1(x1)) = x1
POL(c3(x1, x2)) = x1 + x2
POL(fold#3(x1)) = 0
POL(plus#2(x1, x2)) = 0
(12) Obligation:
Complexity Dependency Tuples Problem
Rules:
fold#3(Nil) → 0
fold#3(Cons(z0, z1)) → plus#2(z0, fold#3(z1))
plus#2(0, z0) → z0
plus#2(S(z0), z1) → S(plus#2(z0, z1))
Tuples:
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
S tuples:none
K tuples:
FOLD#3(Cons(z0, z1)) → c3(PLUS#2(z0, fold#3(z1)), FOLD#3(z1))
PLUS#2(S(z0), z1) → c1(PLUS#2(z0, z1))
Defined Rule Symbols:
fold#3, plus#2
Defined Pair Symbols:
PLUS#2, FOLD#3
Compound Symbols:
c1, c3
(13) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(14) BOUNDS(1, 1)